package Book;

// 书的类
public class book {
    private String name; //书名
    private  String author; // 作者
    private  int price; // 价格
    private  String type; // 类型
    private boolean isBorrowed; // 是否被借出

    public book(String name, String author, int price, String type) {
        this.name = name;
        this.author = author;
        this.price = price;
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAuth0r() {
        return author;
    }

    public void setAuth0r(String auth0r) {
        this.author = auth0r;
    }

    public int getPrice() {
        return price;
    }

    public void setPrice(int price) {
        this.price = price;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public boolean isBorrowed() {
        return isBorrowed;
    }

    public void setBorrowed(boolean borrowed) {
        isBorrowed = borrowed;
    }

    @Override
    public String toString() {
        return "book{" +
                "name='" + name + '\'' +
                ", auth0r='" + author + '\'' +
                ", price=" + price +
                ", type='" + type + '\'' +
                ", isBorrowed=" +
                (isBorrowed == true ? " 已借出 " : " 未借出 ") +
                '}';
    }
}
